<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
	<div id="eva_grayDiv" style="z-index:20;display: none;background: #ECECEC;width: 100%;height: 100%;position: absolute;filter:alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity: 0.5;opacity: 0.5;">
	</div>
		<div id="evaluateDiv" style="z-index:22;display: none;position: absolute;width: 1000px;height: 500px;border: 0px solid #33A7D1;background:url('<%=basePath %>resource/img/brand/win_bg3.png');">
<div style="width: 100%;height: 50px;border-bottom: 2px solid #33A7D1;">
	<table width="99%" height="100%">
	<tr><td style="color: #000000;font-weight: bold;font-size: 16px;padding-left: 5px;"></td><td width="50px" align="right" valign="middle" style="font-weight: bold;padding-right:10px;cursor: pointer;" onclick="hideEvaluate_eva();">&nbsp;</td></tr>
	</table>
</div>

<div style="height:445px; overflow: auto;" align="center" >
<form name="form" method="post" target="eva_pingjiaFrame" action="<%=basePath%>suggest/addSuggest.shtml" enctype="multipart/form-data">
	  <div class="tritable">
	  <table width="600" style="margin-top: 10px;" border="0" cellspacing="10" cellpadding="0">
	  <tr>
	    <td width="200px;"> 标题</td><td align="left"><input style="height: 20px;text-align: left;" id="eva_title" type="text" size="80" maxlength="30" name="suggest.title"  /></td>
	  </tr>
	  <tr>
	  <td>内容：</td><td><textarea style="width:530px;height:250px;word-wrap:break-word;margin-left: 0px;" id="eva_content"></textarea></td>
	  </tr>
	  <tr>
			<td style="padding-left:45px;margin-top: 10px;margin-left: 50px;" align="left" colspan="2">
				<input type="submit" name="button" style="display: none;" id="eva_pjbu"/>
				<input type="button" onclick="pingjia_eva();" name="button" id="eva_button" value="提交"/>&nbsp;&nbsp;
				<input type="button" value="取消" onclick="hideEvaluate_eva();"/>
			</td>
		</tr>
	</table>
	<input type="hidden" name="suggest.content" id="suggestcontent"/>
	</div>
  </form>
  <iframe style="display: none" name="eva_pingjiaFrame" id="eva_pingjiaFrame"></iframe>
</div>
</div>

<div id="evaluate" style="border:0px red solid;position: absolute;z-index: 10;left:0px;top: 200px;padding: 0px;height: 178px;">
<div id="eva_img_" onclick="showEvaluate_eva()" style="border:0px red solid;float: left;height:100%;background: url('<%=basePath %>resource/img/suggest.gif') no-repeat;width:30px;cursor:pointer">&nbsp;</div>
<div id="eva_img_hide" onclick="hideImg();" style="border:0px red solid; float: left;height:100%;width:10px;cursor:pointer"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="left" valign="middle"><div style="width: 100%;height: 50px;background: url('<%=basePath %>resource/img/suggesr_L.gif') no-repeat 0 -63px;"></div></td></tr></table></div>
<div id="eva_img_show" onclick="showImg();" style="border:0px red solid;display:none;float: left;height:100%;width:10px;cursor:pointer"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="left" valign="middle"><div style="width: 100%;height: 50px;background: url('<%=basePath %>resource/img/suggest_R.gif') no-repeat 0 -63px;"></div></td></tr></table></div>
</div>
<script charset="utf-8" src="<%=basePath%>resource/js/kindeditor-4.1/kindeditor.js"></script>
<script src="<%=basePath%>resource/js/jquery-1.4.2.js"></script>
<script>
if('${sessionScope.suggestFlag}'=='hide'){
	hideImg();
}else{
	showImg();
}
var basepath = '<%=basePath%>';
var bodyWidth_eva;

function initevaluate_eva(){
	var heihtTemp = GetPageScroll_eva();
	$("#evaluate").css("top",(heihtTemp +200) + 'px');
	setTimeout('initevaluate_eva()',1000);
}
function GetPageScroll_eva() {
	var x, y;
	if (window.pageYOffset) { // all except IE
		y = window.pageYOffset;
		x = window.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) { // IE 6
		// Strict
		y = document.documentElement.scrollTop;
		x = document.documentElement.scrollLeft;
	} else if (document.body) { // all other IE
		y = document.body.scrollTop;
		x = document.body.scrollLeft;
	}
	return y;
}
function showEvaluate_eva(){
	var heihtTemp = GetPageScroll_eva();
	$("#evaluateDiv").css("top", (heihtTemp + 60) + 'px').css("left",
			(bodyWidth_eva - 1000) / 2 + "px");
	$("#eva_grayDiv,#evaluateDiv").show();
	parent.$("#flexDiv").hide()
}
function hideEvaluate_eva(){
	$("#eva_grayDiv,#evaluateDiv").hide();
	parent.$("#flexDiv").show()
}

function hideImg(){
	var obj = $("#eva_img_");
	var obj_width = obj.width();
	obj_width = parseInt(obj_width,10);
	if(obj_width > 0){
		obj.css("width",(obj_width-1)+"px");
		setTimeout("hideImg()",5);
	}
	$("#eva_img_hide").hide();
	$("#eva_img_show").show();
	$.post( basepath+"suggest/suggestFlagChange.shtml?suggestFlag=hide"
               ,function(message){
	});
}
function showImg(){
	var obj = $("#eva_img_");
	var obj_width = obj.width();
	obj_width = parseInt(obj_width,10);
	if(obj_width <30){
		obj.css("width",(obj_width+1)+"px");
		setTimeout("showImg()",5);
	}
	$("#eva_img_hide").show();
	$("#eva_img_show").hide();
	$.post(basepath+"suggest/suggestFlagChange.shtml?suggestFlag=show"
               ,function(message){
	});
	//.hide('solw');
}

function pingjia_eva(){
	var title = document.getElementById("eva_title");
	if(title.value==''){
		alert("请先填写标题");
		title.focus();
		return false;
	}
	if (editor_eva.html()=='') {
		editor_eva.focus();
		alert("请填写内容");
		return false;
	}
	$("#suggestcontent").val(editor_eva.html());
	
	if (confirm("确认提交吗?"))
		document.getElementById('eva_pjbu').click();
		alert('提交成功');
		hideEvaluate_eva();
		$("#eva_title").val("");
		editor_eva.html("");
       // document.forms[0].submit();
}
function addResult_eva(mes){
	if(mes == '1'){
		// alert('保存成功');
		// $("#title").val("");
		// editor.html('');
	}else{
		alert('保存失败');
	}
	hideEvaluate_eva();
}
  var editor_eva;
        KindEditor.ready(function(K) {
		               editor_eva = K.create('#eva_content', {
		               allowFileManager : true,
		               uploadJson : '../resource/js/kindeditor-4.1/upload_json.jsp',
				       fileManagerJson : '../resource/js/kindeditor-4.1/file_manager_json.jsp',
                       items : [
					 	        'source', '|', 'undo', 'redo', '|', 'cut', 'copy', 'paste',
						         '|', 'justifyleft', 'justifycenter', 'justifyright',
						        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
						        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 
						        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
						        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
						        'table', 'hr', 'emoticons', 'map', 'link', 'unlink'
                  ]
                        
                });
        });

$(function() {
	initFlag_eva = true;
	bodyWidth_eva = $("body").width();
	$("#eva_grayDiv").height($("body").height())
	setTimeout('initevaluate_eva()',1000);
})
</script>